%h1 
	My Blog
%p
	Time now is 
%p= Time.now

%p The first part is aimed at creating forms to take input from the user and using this input to do some operation. I used here the method any_of which is explained in the next section.


=form_tag(search2_path, :method => 'get') do
	=text_field_tag :search, params[:search]
	=submit_tag "search"	
	
%p This is another way I found on the Internet, however, it does not work with me :D!	
= form_tag :controller => 'blog_posts', :action => 'search', :method => 'get' do
	= text_field_tag :search, params[:search], :id => 'search_field'
	= submit_tag "Search", :name => nil
	= link_to_function "Clear", "$('search_field').clear()"

=link_to 'New Post', new_blog_post_path

%p Tutorial 1 : 
=link_to 'Querying', querying_path


%p Tutorial 2 : 
=link_to 'SCOPES', scopes_path

%p Tutorial 3 : 
=link_to 'FINDERS', finders_path

%h2
	My Blogs:
- @blog_posts.each do |blog_post|
	%p
		%b= link_to blog_post.title, blog_post 
	%p created at
	%p= blog_post.time
	%p Tags:
	%p= blog_post.tag1
	%p= blog_post.tag2
	%p= blog_post.tag3
	%p Content:
	%p= blog_post.content
	%p id:	
	%p= blog_post.id

	%p{style: "float: right;"}
		= link_to "Delete", blog_post, method: :delete, confirm: "Are you sure you want to delete this post?"

		= link_to "modify", blog_post, method: :put
	%hr{style: "clear: both;"}

	%br 
